﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Skywave.DataStructure
{
    public class DictionaryHelper<T1, T2>
    {
        public static bool IsSame(Dictionary<T1, T2> dic1, Dictionary<T1, T2> dic2)
        {
            bool r = true;
            if (dic1 != null && dic2 != null)
            {
                if (dic1.Count == dic2.Count)
                {
                    foreach (T1 feKeyOld in dic2.Keys)
                    {
                        if (!dic1.ContainsKey(feKeyOld) || !dic1[feKeyOld].Equals(dic2[feKeyOld]))
                        {
                            r = false;
                            break;
                        }
                    }
                }
                else
                    r = false;
            }
            return r;
        }

    }
}
